#ifndef THREADPOOL_H
#define THREADPOOL_H

typedef struct Threadpool Threadpool;

//创建线程池并初始化
Threadpool *threadpoolcreate(int min, int max, int qusize);

//销毁线程池
int threadpooldestory(Threadpool *pool);

//给线程池添加任务
void threadpooladd(Threadpool *pool, void (*func)(void *), void *arg);

//获取线程池中工作线程个数
int threadpoolbusynum(Threadpool *pool);

//获取活着的线程个数
int threadpoolalivenum(Threadpool *pool);

void *worker(void *arg);
void *manager(void *arg);
void threadexit(Threadpool *pool);

#endif